ActiveReports Developer 7
Grouping in a Data Region
See Also Support Forum
ActiveReports Developer 7 > ActiveReports Developer Guide > How To > Page Report How To > Work with Report Controls and Data Regions > Grouping in a Data Region

Glossary Item Box

In a page report, group your data from a data region on fields and expressions. Each data region provides grouping in a different way.

Use the steps below to learn how to set groups in each data region. These steps assume that you have already added a Page Report template and connected it to a data source. See Adding an ActiveReport to a Project, Connect to a Data Source and Add a Dataset for more information.

Note: This topic uses examples from the Movie table in the Reels database. By default, in ActiveReports, the Reels.mdb file is located at [User Documents folder]\ComponentOne Samples\ActiveReports Developer 7\Data\Reels.mdb.

ShowTo set grouping in a Table

To group data in a Table data region, add group header and footer rows to the table or set detail grouping.

ShowTo add groups in a Table

  1. From the Visual Studio toolbox, drag and drop a Table data region onto the design surface.
  2. With the Table selected on the report, under the Properties window, click the Property dialog link to open the Table dialog.
  3. In the table dialog that appears go to the Groups page and click the Add (+) button to add a group manually.
  4. In this dialog, on the General tab, under Group on enter the field name or expression on which you want to group the data. For e.g., =Fields!YearReleased.Value.
    Note: A default group name like Table1_Group1 appears under Name, until you set the grouping expression under Group On, after which you can modify the group name.
  5. Under the Document map label, you can optionally set a label to add the item to the document map. See Document Map for further information.
  6. Under Parent group, you can optionally set the parent group for a recursive hierarchy.
  7. Click OK to close the dialog. Group header and group footer rows appear right above and below the table details row.
  8. Drag and drop fields onto the Table data region and in the group header row, add the field on which the grouping is set.
  9. Preview the report to see the result.
Tip: You can sort, filter, set page breaks or repeat headers for your grouped data in the other tabs of the Table-Groups dialog.

ShowTo set detail grouping in a Table

Detail Grouping is useful when you do not want to repeat values within the data on display in the report.

  1. From the Visual Studio toolbox, drag and drop a Table data region onto the design surface.
  2. With the Table selected on the report, under the Properties Window, click the Property dialog link to open the Table dialog > Detail Grouping page.
  3. In the Detail Grouping page, under Group on enter the expression on which you want to group the data. For e.g., =Fields!YearReleased.Value
    Note: A default group name like Table1_Detail_Group1 appears under Name, until you set the grouping expression under Group On, after which you can modify the group name.
  4. Under the Document map label, you can optionally set a label to add the item to the document map. See Document Map for further information.
  5. Under Parent group, you can optionally set the parent group for a recursive hierarchy.
  6. Click OK to close the dialog.
  7. Drag and drop fields onto the Table data region and go to the preview tab to see grouped data.
Tip: You can filter, set page breaks or set visibility for your grouped data in the other tabs of the Table-Detail Grouping page.

ShowTo set detail grouping in a List

To group data in a List data region, set detail grouping. Detail Grouping is useful when you do not want to repeat values within the data on display in the report.

  1. From the Visual Studio toolbox, drag and drop a List data region onto the design surface.
  2. With the List selected on the report, under the Properties window, click the Property dialog link to open the List dialog > Detail Grouping page.
  3. In the Detail Grouping page, under Group on enter the expression on which you want to group the data. For e.g., =Fields!YearReleased.Value.
    Note: A default group name like List1_Detail_Group appears under Name, until you set the grouping expression under Group On, after which you can modify the group name.
  4. Under the Document map label field, you can optionally set a label to add the item to the document map. See Document Map for further information.
  5. Under the Parent group field, you can optionally set the parent group for a recursive hierarchy.
  6. Click OK to close the dialog.
  7. Drag and drop fields or other data regions onto the List data region and go to the preview tab to see grouped data.
Tip: You can place lists within lists to create nested grouping. You can also filter, set page breaks or set sorting for your grouped data in the other tabs of the List-Detail Grouping page.

ShowTo set grouping in a BandedList

To group data in a BandedList data region, add the BandedList group header and footer row.

  1. From the Visual Studio toolbox, drag and drop a BandedList data region onto the design surface.
  2. Right-click the BandedList data region and select Insert Group to open the Banded List-Groups dialog.
    OR
    With the BandedList selected on the report, under the Properties Window, click the Property dialog link to open the Banded List dialog > Groups page. However, you have to click the Add (+) button and add the group manually in this case.
  3. In the Groups page, under Group on enter the field name or expression on which you want to group the data. For e.g., =Fields!YearReleased.Value.
    Note: A default group name like BandedList1_Group1 appears under Name, until you set the grouping expression under Group On, after which you can modify the group name.
  4. Under the Document map label field, you can optionally set a label to add the item to the document map. See Document Map for further information.
  5. Under Parent group you can set the parent group for a recursive hierarchy.
  6. Click the OK to close the dialog.
  7. Drag and drop fields onto the BandedList data region and go to the preview tab to see grouped data.

ShowTo set grouping in a Matrix

To group data in a Matrix data region, set row and column groups dynamically or manually in the data region.

ShowTo dynamically group a matrix using dynamic columns and rows

  1. From the Visual Studio toolbox, drag and drop a Matrix data region onto the design surface.
  2. From the Report Explorer, drag a field and drop it onto a row or column header in the matrix. This action adds both an expression to the textbox in the cell and a grouping to the matrix.
  3. From the Report Explorer, drag and drop a field onto the aggregate detail cell of the matrix data region.

ShowTo manually group a matrix using dynamic columns and rows

  1. From the Visual Studio toolbox, drag and drop a Matrix data region onto the design surface.
  2. Right-click a row or column header and choose Insert Group. This adds a new cell below the original column header or to the right of the original row header.
  3. In the Matrix - Column Groups or Row Groups dialog that appears, under Group on enter an expression on which you want to group the data. For e.g., =Fields!YearReleased.Value.
  4. Click OK to close the dialog.
  5. Drag and drop or set fields in the aggregate detail cell of the matrix data region and go to the Preview Tab to view the result.

Or

  1. From the Visual Studio toolbox, drag and drop a Matrix data region onto the design surface.
  2. With the Matrix data region selected on the report, under the Properties Window, click the Property dialog link to open the Matrix dialog.
  3. In the Column Groups or Row Groups page, click the Add button to add a new group and a new cell below the original column header or to the right of the original row header.
  4. Enter an expression under Group on on which you want to group the data. For e.g., =Fields!YearReleased.Value.
  5. Click OK to close the dialog.
  6. Drag and drop or set fields in the aggregate detail cell of the matrix data region and go to the Preview Tab to view the result.
Note: A default group name like Matrix1_RowGroup1 or Matrix1_ColumnGroup1 appears under Name, until you set the grouping expression under Group On, after which you can modify the group name.

ShowTo set grouping in a Chart

To group data in a Chart data region, set grouping for categories or series. In a Chart, you can set groups directly on the design surface or add category groups and series groups manually.

ShowTo dynamically group a Chart category or series

  1. From the Visual Studio toolbox, drag and drop a Chart data region onto the design surface.
  2. From the Report Explorer,
  3. Drag a field near the lower edge of the Chart and drop it onto the part that reads Drop category fields here. This action groups the categorized chart data on the field set here.
  4. Drag a field near the upper edge of the Chart and drop it onto the part that reads Drop data fields here. This adds data which is to be grouped to the chart.
  5. Drag a field near the right edge of the Chart and drop it onto the part that reads Optionally drop series fields here. This action groups data on series.

ShowTo manually group a Chart category or series

  1. From the Visual Studio toolbox, drag and drop a Chart data region onto the design surface.
  2. With the Chart data region selected on the report, under the Properties Window, click the Chart Data link to open the Chart Data dialog.
  3. In the Chart Data dialog, go to the Category Groups page and click the Add button to add a new group.
  4. Enter an expression under Group on on which you want to categorize the data. For e.g., =Fields!Title.Value.
  5. In the Chart Data dialog, go to the Series Groups page and click the Add button to add a new group.
  6. Enter an expression under Group on on which you want to group your series data. For e.g., =Fields!Country.Value.
  7. Click OK to close the dialog.
  8. Drag the UserRating field near the upper edge of the Chart and drop it onto the part that reads, Drop data fields here. This adds data which is to be grouped to the chart.
Note: A default group name like Chart1_CategoryGroup1 or Chart1_SeriesGroup1 appear under Name, until you set the grouping expression under Group On, after which you can modify the group name.

See Also

©2014. ComponentOne, a division of GrapeCity. All rights reserved.